package project24;

import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        ArrayList<String> arr = new ArrayList<>();
        String n;
        int flag=0;
        n=sc.nextLine();
        String[] std=n.split(" ");
        for(int k=0;k<std.length;++k)
        {
            if(std[0].equals(String.valueOf(std[k].charAt(0))))
            {
                flag++;
            }
        }
        System.out.println(flag-1);
    }
}
